package com.city.domain.pub;

import javax.persistence.*;
import java.util.Objects;

/**
 * @deprecation: 公共文章
 * @dmail: 398521613@qq.com
 * @author: L-H
 * @date: 2018-07-18 13:14
 */
@Entity
@Table(name = "pub_article", schema = "city", catalog = "")
public class PubArticle {
    private int id;//主键
    private String typeName;//文章类别
    private String title;//标题
    private String subTitle;//副标题
    private String thumb;//缩略图
    private int status;//文章状态
    private String introduce;//简介
    private String content;//内容
    private String theSource;//来源
    private String inputer;//录入者
    private String keyword;//关键词
    private int hits;//阅读量
    private int postNum;//评论数
    private int ontop;//是否置顶：1，置顶；0，不置顶
    private int isslite;//是否推荐：1，推荐；0，不推荐
    private String createTime;//创建时间
    private String addTime;//文章添加时间
    private String updateTime;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "type_name")
    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "sub_title")
    public String getSubTitle() {
        return subTitle;
    }

    public void setSubTitle(String subTitle) {
        this.subTitle = subTitle;
    }

    @Basic
    @Column(name = "thumb")
    public String getThumb() {
        return thumb;
    }

    public void setThumb(String thumb) {
        this.thumb = thumb;
    }

    @Basic
    @Column(name = "status")
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Basic
    @Column(name = "introduce")
    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTheSource() {
        return theSource;
    }

    public void setTheSource(String theSource) {
        this.theSource = theSource;
    }

    @Basic
    @Column(name = "inputer")
    public String getInputer() {
        return inputer;
    }

    public void setInputer(String inputer) {
        this.inputer = inputer;
    }

    @Basic
    @Column(name = "keyword")
    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    @Basic
    @Column(name = "hits")
    public int getHits() {
        return hits;
    }

    public void setHits(int hits) {
        this.hits = hits;
    }

    @Basic
    @Column(name = "post_num")
    public int getPostNum() {
        return postNum;
    }

    public void setPostNum(int postNum) {
        this.postNum = postNum;
    }

    @Basic
    @Column(name = "ontop")
    public int getOntop() {
        return ontop;
    }

    public void setOntop(int ontop) {
        this.ontop = ontop;
    }

    @Basic
    @Column(name = "isslite")
    public int getIsslite() {
        return isslite;
    }

    public void setIsslite(int isslite) {
        this.isslite = isslite;
    }

    @Basic
    @Column(name = "create_time")
    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "add_time")
    public String getAddTime() {
        return addTime;
    }

    public void setAddTime(String addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "update_time")
    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PubArticle that = (PubArticle) o;
        return id == that.id &&
                typeName == that.typeName &&
                status == that.status &&
                hits == that.hits &&
                postNum == that.postNum &&
                ontop == that.ontop &&
                isslite == that.isslite &&
                Objects.equals(title, that.title) &&
                Objects.equals(subTitle, that.subTitle) &&
                Objects.equals(thumb, that.thumb) &&
                Objects.equals(introduce, that.introduce) &&
                Objects.equals(content, that.content) &&
                Objects.equals(theSource, that.theSource) &&
                Objects.equals(inputer, that.inputer) &&
                Objects.equals(keyword, that.keyword) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(addTime, that.addTime) &&
                Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, typeName, title, subTitle, thumb, status, introduce, content, theSource, inputer, keyword, hits, postNum, ontop, isslite, createTime, addTime, updateTime);
    }
}
